﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using HA.MT3DMS.FileLayer;

namespace HA.MT3DMS.DomainLayer
{
    [Serializable]
    public class GCGSolver:ICloneable 
    {
        private int _MXITER=1;//外部迭代的最大数;只有当模拟中包含一个非线性吸附等温线时MXITER应被设为一个大于1的整数.
        /// <summary>
        /// 外部迭代的最大数;只有当模拟中包含一个非线性吸附等温线时MXITER应被设为一个大于1的整数.
        /// </summary>
        public int MXITER
        {
            get { return _MXITER; }
            set { _MXITER = value; }
        }
        private int _ITER1=50;//内部迭代的最大数;对于大多数问题一个介于30到50之间的数值是适宜的
        /// <summary>
        /// 内部迭代的最大数;对于大多数问题一个介于30到50之间的数值是适宜的
        /// </summary>
        public int ITER1
        {
            get { return _ITER1; }
            set { _ITER1 = value; }
        }

        private int _ISOLVE=1;
        /// <summary>
        /// 是Lanczoz/ORTHOMIN加速方案适用的先决条件种类
        ///  =1,Jacobi
        ///   =2,SSOR
        ///    =3,Modified Incomplete Cholesky(MIC)(MIC一般汇聚的更快,但它明显需要更大的内存)
        /// </summary>
        public int ISOLVE
        {
            get { return _ISOLVE; }
            set { _ISOLVE = value; }
        }

        private int _NCRS;
        /// <summary>
        /// 标示对扩散张量交叉项的处理
        /// =0,将所有扩散交叉项向右放在一起(相近但高效)
        /// =1,包括完整的扩散张量(需要大量内存)
        /// </summary>
        public int NCRS
        {
            get { return _NCRS; }
            set { _NCRS = value; }
        }

        private double _ACCL=1.0;
        /// <summary>
        /// 是SSOR选项的松弛系数;一般一个1.0的数值是适宜的
        /// </summary>
        public double ACCL
        {
            get { return _ACCL; }
            set { _ACCL = value; }
        }

        private double _CCLOSE = 0.0001;
        /// <summary>
        /// 是相对浓度的汇聚标准;一般一个介于10-4和10-6之间的实数是适宜的.
        /// </summary>
        public double CCLOSE
        {
            get { return _CCLOSE; }
            set { _CCLOSE = value; }
        }

        private int _IPRGCG=0;
        /// <summary>
        /// 是列印每个迭代的最大浓度变化的间隔时间.在每个应力期结束时列印,将IPRGCG默认设置为零.
        /// </summary>
        public int IPRGCG
        {
            get { return _IPRGCG; }
            set { _IPRGCG = value; }
        }



        public GCGSolverPack ToPack()
        {
            GCGSolverPack Gcg = new GCGSolverPack();
            Gcg.MXITER = this.MXITER;
            Gcg.ITER1 = this.ITER1;
            Gcg.ISOLVE = this.ISOLVE;
            Gcg.NCRS = this.NCRS;
            Gcg.ACCL = this.ACCL;
            Gcg.CCLOSE = this.CCLOSE;
            Gcg.IPRGCG = this.IPRGCG;

            return Gcg;
        }



        public object Clone()
        {
            return this.MemberwiseClone();
        }
    }
}
